package com.vunken.tv_sharehome.greendao.dao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.vunken.tv_sharehome.greendao.dao.bean.Contact;
import com.vunken.tv_sharehome.greendao.dao.bean.CallRecorders;
import com.vunken.tv_sharehome.greendao.dao.bean.WhiteContanct;

import com.vunken.tv_sharehome.greendao.dao.ContactDao;
import com.vunken.tv_sharehome.greendao.dao.CallRecordersDao;
import com.vunken.tv_sharehome.greendao.dao.WhiteContanctDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig contactDaoConfig;
    private final DaoConfig callRecordersDaoConfig;
    private final DaoConfig whiteContanctDaoConfig;

    private final ContactDao contactDao;
    private final CallRecordersDao callRecordersDao;
    private final WhiteContanctDao whiteContanctDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        contactDaoConfig = daoConfigMap.get(ContactDao.class).clone();
        contactDaoConfig.initIdentityScope(type);

        callRecordersDaoConfig = daoConfigMap.get(CallRecordersDao.class).clone();
        callRecordersDaoConfig.initIdentityScope(type);

        whiteContanctDaoConfig = daoConfigMap.get(WhiteContanctDao.class).clone();
        whiteContanctDaoConfig.initIdentityScope(type);

        contactDao = new ContactDao(contactDaoConfig, this);
        callRecordersDao = new CallRecordersDao(callRecordersDaoConfig, this);
        whiteContanctDao = new WhiteContanctDao(whiteContanctDaoConfig, this);

        registerDao(Contact.class, contactDao);
        registerDao(CallRecorders.class, callRecordersDao);
        registerDao(WhiteContanct.class, whiteContanctDao);
    }
    
    public void clear() {
        contactDaoConfig.getIdentityScope().clear();
        callRecordersDaoConfig.getIdentityScope().clear();
        whiteContanctDaoConfig.getIdentityScope().clear();
    }

    public ContactDao getContactDao() {
        return contactDao;
    }

    public CallRecordersDao getCallRecordersDao() {
        return callRecordersDao;
    }

    public WhiteContanctDao getWhiteContanctDao() {
        return whiteContanctDao;
    }

}
